package game;

public class HandValue {
	public enum Type{
		ROYALFLUSH(1),STRAIGHTFLUSH(2),FOUROFAKIND(3),FULLHOUSE(4),FLUSH(5),STRAIGHT(6),THREEOFAKIND(7),TWOPAIR(8),ONEPAIR(9),HIGHCARD(10);
		private int val;
		Type(int value){
			val = value;
		}
		public int getVal(){
			return val;
		}
	}
	private Type handType;
	private Card.Value highCard;
	public HandValue(Type type, Card.Value card){
		handType = type;
		highCard = card;
	}
	public boolean betterHand(HandValue compare){
		if (compare.handType.getVal() < handType.getVal()){
			return true;
		}
		else if (compare.handType == handType){
			if (compare.highCard.value() > highCard.value()){
				return true;
			}
			return false;
		}
		return false;
	}
	public boolean equals(Object o){
		if (o instanceof HandValue){
			HandValue other = (HandValue)o;
			return other.handType == handType &&other.highCard == highCard;
		}
		return false;
	}

}
